import Vue from 'vue'
import Vuex from 'vuex'
// 导入提取的getters文件
import getters from './getters'
// 导入拆分的模块
import app from './modules/app'
import settings from './modules/settings'
import user from './modules/user'
// 挂载vuex
Vue.use(Vuex)
// vuex实例化
const store = new Vuex.Store({
  modules: {
    app,
    settings,
    user
  },
  // 类似于Vue的计算属性conputed
  getters
  // getters :{
  // sidebar: state => state.app.sidebar,
  // device: state => state.app.device,
  // token: state => state.user.token,
  // avatar: state => state.user.avatar,
  // name: state => state.user.name
  // }
})

export default store
